package main

import (
	"fmt"
	"kafka-study/kafka"
)

func main() {
	addr := "127.0.0.1:9092"
	//err := kafka.CreateTopic(addr, "top")
	//if err != nil {
	//	fmt.Println(err)
	//}
	list, err := kafka.TopicList(addr)
	if err != nil {
		panic(err)
	}
	fmt.Println(list)
	if len(list) == 0 {
		return
	}
	go kafka.Produce(addr, list[0], "sds都试试!34")
	kafka.Consume(addr, list[0])
}
